package com.copera.cn.kaka;

import android.content.Intent;
import android.content.pm.ActivityInfo;
import android.os.Bundle;
import android.view.View;
import android.widget.RelativeLayout;
import android.widget.TextView;

import com.copera.cn.kaka.util.ActivityManager;

/**
 * 分享设置
 * @author Administrator
 *
 */
public class ShareActivity extends BaseActivity{
	private RelativeLayout back;
	private RelativeLayout relative_03;//启用分享
	private RelativeLayout relative_05;//累计分享
	private RelativeLayout relative_07;//赠送点卡
	private RelativeLayout relative_09;//每人每天最多分享
	private TextView enabled,totalamount,zsdkamount,zudzamount;
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		ActivityManager.getInstance().push(this);
		setContentView(R.layout.share_set);
		back = (RelativeLayout) findViewById(R.id.back);
		relative_03 = (RelativeLayout) findViewById(R.id.relative_03);
		relative_05 = (RelativeLayout) findViewById(R.id.relative_05);
		relative_07 = (RelativeLayout) findViewById(R.id.relative_07);
		relative_09 = (RelativeLayout) findViewById(R.id.relative_09);
		enabled = (TextView) findViewById(R.id.enabled);
		totalamount = (TextView) findViewById(R.id.totalamount);
		zsdkamount = (TextView) findViewById(R.id.zsdkamount);
		zudzamount = (TextView) findViewById(R.id.zudzamount);
		back.setOnClickListener(new View.OnClickListener() {

			@Override
			public void onClick(View v) {
				finish();

			}
		});
		relative_03.setOnClickListener(new View.OnClickListener() {

			@Override
			public void onClick(View v) {
				Intent intent = new Intent();
				intent.setClass(ShareActivity.this, ShareEnabledActivity.class);
				startActivity(intent);

			}
		});
		relative_05.setOnClickListener(new View.OnClickListener() {

			@Override
			public void onClick(View v) {
				Intent intent = new Intent();
				intent.setClass(ShareActivity.this, ShareTotalActivity.class);
				startActivity(intent);

			}
		});
		relative_07.setOnClickListener(new View.OnClickListener() {

			@Override
			public void onClick(View v) {
				Intent intent = new Intent();
				intent.setClass(ShareActivity.this, SharePresenterActivity.class);
				startActivity(intent);

			}
		});
		relative_09.setOnClickListener(new View.OnClickListener() {

			@Override
			public void onClick(View v) {
				Intent intent = new Intent();
				intent.setClass(ShareActivity.this, ShareDayActivity.class);
				startActivity(intent);

			}
		});
		//强制为竖屏 
		setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
	}
	@Override
	protected void onResume() {
		if(getAppCustomer().getShareSetVo()!=null){
			enabled.setText(getAppCustomer().getShareSetVo().getEnabled()==null?"关闭":getAppCustomer().getShareSetVo().getEnabled());
			totalamount.setText(getAppCustomer().getShareSetVo().getTotalCount()==null?"0":getAppCustomer().getShareSetVo().getTotalCount()+"次");
			zsdkamount.setText(getAppCustomer().getShareSetVo().getPresenterCount()==null?"0":getAppCustomer().getShareSetVo().getPresenterCount()+"个卡点");
			zudzamount.setText(getAppCustomer().getShareSetVo().getDayCount()==null?"0":getAppCustomer().getShareSetVo().getDayCount()+"次");
		}
		super.onResume();
	}
	
}
